package com.lagou.course.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.lagou.course.CourseService;
import com.lagou.entity.Course;
import mapper.CourseDao;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {

    @Autowired
    private CourseDao courseDao;

    //查询所有课程
    @Override
    public List<Course> getAllCourse() {
        return courseDao.getAllCourse ();
    }

    //查询用户购买的所有课程
    @Override
    public List<Course> getCourseByUserId(String userId) {
        return courseDao.getCourseByUserId (userId);
    }

    //查询一门课程
    @Override
    public Course getCourseById(String courseid) {
        return courseDao.getCourseById (courseid);
    }
}
